package com.wu.common.utils;


import com.wu.common.page.PageList;

public class SystemTools {
    public SystemTools() {
    }

    public static PaginatedList convertPaginatedList(PageList<?> list) {
        PaginatedList paginatedList = null;
        if (list != null && list.getPagenation() != null) {
            paginatedList = new PaginatedArrayList(list.getPagenation().getPageNo(), list.getPagenation().getPageSize());
            paginatedList.setIndex(list.getPagenation().getPageNo());
            paginatedList.setPageSize(list.getPagenation().getPageSize());
            paginatedList.setTotalItem(list.getPagenation().getItemCount());
            paginatedList.addAll(list.getValues());
        }

        return paginatedList;
    }
}
